package com.iris.live.services.services;

import com.iris.live.services.data.models.*;
import com.iris.live.services.models.PageData;
import com.iris.live.services.models.RequestBase;
import com.iris.live.services.models.ResultData;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by Xin on 7/8/2016
 */
public interface InsuranceService {

    PageData getInsuranceInfoList(String liveName, String permit, GetInsuranceInfoListRequest request);

    ResultData getInsuranceAccountInfo(String liveName, String permit, GetInsuranceInfoListRequest request);

    Object getInsuranceInfoByCode(String permit,int code);

    List getInsuranceCompanyList(String permit);

    List getInsuranceCompanyListByLicense(String license);

    boolean saveInsuranceCompanyStatus(int id, String status);

    boolean saveInsuranceCompanyStatusByLicense(int id, String license, String status);

    Map<String, Object> saveInsuranceCompany(InsuranceService.SaveInsuranceCompany model);

    List<Map> saveInsuranceCompanyBatch(List<InsuranceService.SaveInsuranceCompany> modelList);

    PageData getSuggestPlan(String permit, RequestBase request);

    Lsh保险设置Model saveSuggestPlan(Lsh保险设置Model model);

    List<Lsh保险设置Model> saveSuggestPlanBatch(String license, int companyId, int companyId1, int carTypeId,
                                            List<Lsh保险设置Model> modelList, String seatsNumber);

    List getFailReason();

    boolean saveFailReasonStatus(int id, String status);

    报价保险表Model getInsuranceOfferById(int id);

    Map getInsuranceOffersById(int id);

    ResultData saveInsuranceOffer(报价保险表Model model, String code, String userName, String permit);

    List getInsuranceOfferDetailsByOfferId(int offerId);

    boolean saveInsuranceOfferDetailsVVT(int id, String quCode, List<报价保险详细表Model> modelList, String userName);

    List saveInsuranceOfferDetailsWithoutVVT(int id, List<报价保险详细表Model> modelList);

    Object getFailReasonByInsuranceCode(String code);

    Object getPreFailReasonByInsuranceCode(String code, String insId);

    /**
     * 保存保险公司手续费设置
     */
    List<Lsh保险手续费Model> saveInsuranceCompanyPoundage(List<Lsh保险手续费Model> modelList);

    boolean deleteInsuranceOfferDetailsWithoutVVT(TradeInsInfo tradeInsInfo);

    boolean saveOrderFailReason(String orderId, Integer reasonId, String userName);

    boolean saveSelectableInsuranceCompanyCount(Itask基础设置Model model);

    Itask基础设置Model getSelectableInsuranceCompanyCount(Itask基础设置Model model);

    String getlastUpdateTime();

    List getComboList(String permit);

    List getInsComList();

    List getCoInsCompanyList();

    PageData getDealerInsList(RequestBase requestBase);

    List getInsFailList();

    boolean updateInsFailList(InsuranceService.updateInsFail updateInsFail,String username,String permit);

    List getRealInsFailList(RealInsFail realInsFail );

    ResultData getcarForceInsInformation(String InsId);

    ResultData getcarCommercialInsInformation(String InsId);

    ResultData getTradeInsInfoList(TradeInsInfo tradeInsInfo);

    ResultData savecarForceInsInformation(String InsId, String saveid, getUpdateInsuranceOrderInfo realInsFail, String zhanghao);

    ResultData saveCommercialInsInformation(String InsId, String saveid, String year, getUpdateInsuranceOrderInfo realInsFail, String zhanghao, String tYear);


    boolean saveInsuranceFeeAndDelete(int InsId, int year, List<getTypeInsurance> realInsFail, String zhanghao);

    boolean sendInsInfo(InsuranceService.SendInsInfo sendInsInfo, String permit, String userName);

    ResultData getInsIcWorkInfo(String permit, String userName);

    ResultData getInsCarInfo(String code);

    ResultData updateInsSate(String code, String sate, String userName);

    ResultData getInsHistoryInfo(String code);

    ResultData updateInsFactorage(String inscode, String code, String permit, String userName);

    ResultData updateInsuranceByQuote(String quote, String userName);

    ResultData getconfirmInsState(String userName, String code, String logTime);

    ResultData saveInsCarInfo(InsCarInfo insCarInfo);

    ResultData getInsCost(String InsCode);

    ResultData getPolicyReasonInfo(String permit);

    ResultData saveRevokeInfo(String permit, String userName, InsurancePolicyReason reason);

    ResultData saveInsuranceEndorsementLog(String userName, List<InsuranceService.InsuranceEndorsementLog> insuranceEndorsementLog);

    ResultData getOtherInsuranceInfo(String permit, OtherInsuranceInfo otherInsuranceInfo);

    ResultData getOthergetInsuranceAccountInfo(String permit, OtherInsuranceInfo otherInsuranceInfo);

    void exportOtherInsuranceAccountInfo(String permit, OtherInsuranceInfo otherInsuranceInfo, HttpServletResponse response);

    ResultData getInsuranceOtherCarInfo(String vin);

    ResultData getInsuranceOtherICInfo(String vin);

    ResultData getInsuranceBcInfo(String vin);

    ResultData saveInsuranceOtherCarInfo(InsuranceService.SaveInsuranceOtherCarInfo info, String userName, String permit);

    ResultData saveInsuranceOtherICInfo(InsuranceService.SaveInsuranceOtherICInfo info, String userName, String permit);

    ResultData saveInsuranceOtherBCInfo(InsuranceService.SaveInsuranceOtherInfo info, String userName, String permit);

    ResultData getInsuranceHistoryInfo(String carid);

    ResultData getBuyInfo(Integer pId);

    ResultData getInsuranceCompanyByBrand(String brand,String permit,int carID);

    ResultData saveInsuranceBcManyYears(List<TEndorsementInfoModel> modelList, String userName, String permit,Integer carId);

    void exportInsuranceAccountInfo(HttpServletResponse response,String liveName, String permit, GetInsuranceInfoListRequest request);

    /**
     * 删除常用车型推荐方案设置
     * @param permit 许可
     * @param carId 车型编号
     * @return 返回
     */
    ResultData deleteSuggestPlan(String permit,Integer carId);

    List getInsDefeatedResonRpt();

    List getInsuranceCompany();

    class GetInsuranceInfoListRequest extends RequestBase {

        public String tciNo;
        public String vciNo;
        public String tciCompany;
        public String vciCompany;
        public String salesName;
        public String status;
        public String username;
        public String userPhone;
        public String vin;
        public String type;
        public Date startEnterDate;
        public Date endEnterDate;
        public Date startDueDate;
        public Date endDueDate;
        public Date startOrderDate;
        public Date endOrderDate;
        public Date startExpectInvoiceDate;
        public Date endExpectInvoiceDate;
        public String orderRelyType;
        public String forceInsuranceStartDate;   // 交强险出单日期 开始
        public String forceInsuranceEndDate;  // 交强险出单日期  截止
        public String commercialInsuranceStartDate;  // 商业险出单日期 开始
        public String commercialInsuranceEndDate;  // 商业险出单日期 截止
    }

    class SaveInsuranceCompany extends RequestBase {
        public Integer 保险公司编号;
        public String 保险公司;
        public String 状态;
        public String brand;
        public Integer areaId;
        public String 启用状态;
        public Timestamp 创建时间;
        public String 更新账号;
        public Timestamp 更新时间;

        public String 使用状态;

        public String 许可;
        public String 交强险手续费;
        public String 商业险手续费;
        public String 备注;
        public String 客户类别;
    }

    class  updateInsFail  extends RequestBase {
        public  String id;
        public  String reinsFailReason;//保险准战败原因;
        public  String insFailReason; // 保险战败原因;
        public  String failReason ; //战败原因;
        public  String state;//状态;

    }

    class RealInsFail  extends RequestBase{
        public  String   reason;//战败原因
    }

    class  TradeInsInfo extends RequestBase{
      public   String insId;  //保险编号
        public String quCode;//初始报价单号
      public    String  year;//保险第N年
    }

    class getUpdateInsuranceOrderInfo {
        public int DateSums;  // 第几年 商业险的 第几年

        public String UserName;// 被保险人的 姓名
        public String UserSex;// 被保险人的 性别
        public String UserType;// 被保险人的 类型
        public String UserTel;// 被保险人的 电话
        public String UserIdCard;// 被保险人的 身份证号码
        public String UserOrganizeCode;// 组织机构代码

        public String UserAddrCity1;// 地址1 省
        public String UserAddrCountry2;// 地址1  市
        public String UserAddrIsland3;// 地址1 区

        public String UserAddrCode;// 邮编
        public String UserAddrDetai4;//  具体 龙华东路


        public String InsuranceOutDt;// 交出险 出单日期
        public String InsuranceOutSumDt;// 投保期
        public String InsuranceOutCompany;// 保险公司
        public BigDecimal InsuranceMoney;// 保费

        public String InsuranceOrderId;// 交强险 保单号
        public String InsuranceStarUseDt;// 有效日期 开始
        public String InsuranceEndUseDt;// 有效日期 开始

        public String insuranceOrderRelyType;//批单类型  00  批增 01 批减  02  批退
        public String InsuranceOrderRelyId;// 批单号
        public String InsuranceOrderRelyDt;// 批单日期
        public String InsuranceOrderRelyOutDt;// 退保日期
        public String retreatReason;//退保原因
        public String InsuranceOrderRelyOutEndDt;// 保单终止日期
        public String MaxYear;//最大年份

        public String InsuranceOrderRelyMoney; // 交强险保费
        public String vehicleAndVesselTax;
        public Double endorsementMoney;  //批单金额
        public String permit; // 许可

    }


    class getTypeInsurance {

        public String type;
        public String baoe;
        public String baofei;
        public String mainpei;
/*“险种”:””,
            “保额”:””,
            “保费”:””,
            “不计免赔”:””*/

    }

    class SendInsInfo {
        public String salesCode;//销售顾问号
        public String state;//状态
        public String cusName;//顾客名
        public String teleNumber;//顾客电话
    }

    class InsCarInfo {
        public String insCarType;//保险机动车种类
        public String manCount;//核载人数
        public String quality;//核载质量
        public String displacement;//排量
        public String power;//功率
        public String carID;//牌照
        public String useType;// 使用性质
        public String registerDate;//登记日期
        public Integer submitCarID;//交车编号
        public Integer invId;//库存编号
        public String quCode;//初始报价单号
    }

    class InsurancePolicyReason extends ResultData {
        public Integer id;
        public String reason;
        public String state;

    }

    class InsuranceEndorsementLog extends RequestBase {
        public String endorsementCode;//批单号
        public String orgQuoteId;//初始报价单号
        public String insuranceName;//险种
        public Integer yearNum;//第几年
        public String parameter;//参数
        public String iop;//不计免赔
        public String subParameter;//附加参数
        public BigDecimal orgPrice;//原价
        public BigDecimal finPrice;//折后价
    }

    class OtherInsuranceInfo extends RequestBase {
        public String icPolicyNo;//(交强险保单号)(模糊查询)
        public String bcPolicyNo;//(商业险保单号)(模糊查询)
        public String icInsuranceCpy;//(交强险保险公司)(精确查询)
        public String bcInsuranceCpy;//(商业险保险公司)(精确查询)
        public String sale;//(销售顾问)(精确查询)
        public String cusName;//(客户姓名)(模糊查询)
        public String carBrand;//(品牌)(模糊查询)
        public String carModel;//(车型)(模糊查询)

    }

    class SaveInsuranceOtherCarInfo {
        public Integer carid;//车型信息编号
        public String carNumber;//(车牌号)
        public String vehicleType;//(机动车种类
        public String bBenz;//(是否奔驰)
        public String carBrand;//(品牌)
        public String carLevel;//(级别)
        public String carModel;//(车型)
        public String carDetail;//(车款)
        public String useCharacter;//(使用性质)
        public String motorNumber;//(发动机号码)
        public String registerDate;//(登记日期)
        public String vin;//(VIN码)
        public Integer passengerNumber;//(核定载客人数)
        public String passengerQuality;//(核定载客质量)
        public String displacement;//(排量)
        public String capacity;//(功率)
    }


    class SaveInsuranceOtherICInfo {
        public Integer carid;//车型信息编号
        public String cusName;//(姓名)
        public String sexuallity;//(性别)
        public String cusType;//(客户类型)
        public String id;//(身份编号)
        public String cusTel;//(客户电话)
        public String province;//(省份)
        public String city;//(城市)
        public String region;//(行政区)
        public String postNumber;//(邮编)
        public String detailAddress;//(详细地址)
        public String issuingDate;//(出单日期)
        public Integer preiod;//(投保期)
        public String insuranceCpy;//(保险公司)
        public Double additionalPremium;//(保费)
        public String policyNumber;//(保单号)
        public String invalidStart;//(有效期开始)
        public String invalidEnd;//(有效期结束)
        public String endorsementNumber;//(批单号)
        public String endorsementDate;//(批单日期)
        public String endorsementType;//(批单类型)
        public String endorsementNote;//(退单备注)
        public String policyTerminationDate;//(保单终止日期)
        public Integer pId;
        public Double endorsementMoney;  //批单金额
        public Double currentYearPremium; // 商业险的当年保费
    }

    class SaveInsuranceOtherInfo extends SaveInsuranceOtherICInfo {
        public List<TInsBuyinfoModel> info;
        public String year;
    }


}
